package com.yanxml.springboot.core.starter.demo.controller;

import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/hello")
public class HelloController {

    @Autowired
    private RedissonClient redissonClient;

    @ResponseBody
    @RequestMapping(path = "/query", method = RequestMethod.GET)
    public String query() {
        return "keys-Count:" + redissonClient.getKeys().count();
    }

}
